<?php
require_once dirname(__FILE__) . '/../includes/common.inc.php';
require_once dirname(__FILE__) . '/../includes/pdoorm.inc.php';

header('Content-Type: text/plain');
die;
$sql="
    insert into ns_v1payment
    SELECT   
	  aa.`e_oid`,
	  aa.`trackId`,
	  aa.`cancelled`,
	  aa.`createdDate`,
	  aa.`date`,
	  aa.`amount`,
	  aa.`method`,
	  aa.`stage`,
	  aa.`userAccount`,
	  aa.`orderFlag`,
	  aa.`orderTrackId`,
	  bb.oid_a AS orderId,
	  aa.`customerId`,
	  aa.`isPdSolved`,
	  aa.`pdSolvedNote`,
	  aa.`cancelledDate`,
	  aa.`cancelledOperator`,
	  aa.`cancelledMessage`,
	  aa.`pdAdmAppr`,
	  aa.`status` 
	FROM ns_payment as aa LEFT JOIN ns__ez_relation_myorder_payment AS bb
	ON aa.e_oid = bb.oid_b
";

sql_execute($sql);
